<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>店铺</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <link rel="stylesheet" href="../../css/main.css">
    <style></style>
</head>

<body>
    <div class="app" v-cloak>
        <div class="header-common">
            <div class="flex-x-sb header">
                <span class="iconfont goback" @click="back">&#xe66f;</span>
                <div class="title">
                    {{title}}
                </div>
                <div style="width: .25rem;"></div>
            </div>
            <van-tabs v-if="type==1" v-model="active" color="#3F8CEC" title-active-color="#3F8CEC" line-height="1px" @click="setFrameGroupIndex">
                <van-tab title="未提现"></van-tab>
                <van-tab title="提现中"></van-tab>
            </van-tabs>
        </div>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script src="../../script/vant.min.js"></script>
    <script src="../../script/common.js"></script>
    <script>
        apiready = function() {
            vm = new Vue({
                el: '.app',
                data: {
                    title: '余额',
                    active:0,
                    type:api.pageParam.type
                },
                mounted() {
                    var type = this.type
                    var url;
                    if (type == 1) {
                        this.title = '余额'
                        this.openFrameGroup()
                    } else{
                        if (type == 2) {
                            this.title = '在途资金'
                        } else if (type == 3) {
                            this.title = '历史提现'
                        }
                        this.openFrame()
                    }
                    
                },
                methods: {
                    openFrame(){
                        var vm = this;
                        var header = $api.dom('.header-common');
                        var headerH = $api.fixStatusBar(header);
                        api.openFrame({
                            name: 'balance_history_frm',
                            url: 'balance_history_frm.html',
                            rect: {
                                marginTop: headerH,
                                marginBottom: 0,
                                w: 'auto'
                            },
                            pageParam: api.pageParam,
                        });
                    },
                    back() {
                        api.closeWin();
                    },
                    openFrameGroup(){
                        var vm = this;
                        var header = $api.dom('.header-common');
                        var headerH = $api.fixStatusBar(header);
                        api.openFrameGroup({
                            name: 'balance_group',
                            rect: {
                                marginTop: headerH+10,
                                marginBottom: 0,
                                w: 'auto'
                            },
                            scrollEnabled: true,
                            frames:[{
                                name: 'balance_no',
                                url: 'balance_no_frm.html',
                                pageParam:api.pageParam
                            }, {
                                name: 'balance_ing',
                                url: 'balance_ing_frm.html',
                                pageParam:api.pageParam
                            }],
                            preload: 0,
                        }, function(ret, err) {
                            vm.active = ret.index;
                        });
                    },
                    setFrameGroupIndex() {
                        api.setFrameGroupIndex({
                            name: 'balance_group',
                            scroll: true,
                            index: this.active,
                            // reload: true
                        });
                    },
                    
                },
            })
        }
    </script>
</body>

</html>